# while 循环

current_number = 1
while current_number <= 5:
    print(current_number)
    current_number += 1

propmt = '\nTell me something, and I will repeat it back to you:'
propmt += "\nEnter 'exit' to end the program."

# messge = ''
# while messge != 'exit':
#     messge = input(propmt)
#     if messge != 'exit':
#         print(messge)

# 使用标志、break 退出 while 循环
# active = True
# while active:
#     message = input(propmt)

#     if message == 'quit':
#         # active = False
#         break
#     else:
#         print(message)

# 使用 continue

current_number = 0
while current_number < 10:
    current_number += 1
    if (current_number % 2 == 0):
        continue
    print(current_number)

pets = ['dog', 'cat', 'dog', 'goldfish', 'cat', 'rabbit', 'cat']

print('pets:\n\t', pets)

while 'cat' in pets:
    pets.remove('cat')

print('pets:\n\t', pets)

responses = {}
polling_active = True

while polling_active:
    name = input('\nWhat is your name?')
    response = input('Which mountain would you like to climb someday?')

    responses[name] = response

    repeat = input('Would you like to let another person respond?(yes / no)')
    if repeat == 'no':
        polling_active = False

print('\n --- Poll Results ---')

for name, response in responses.items():
    print(name + ' would like to climb ' + response + '.')
